<style scoped>

</style>
<template>
	<div id="demo">
		<el-row>
  			<el-button @click="getToken" type="primary" round>主要按钮</el-button>
		</el-row>

	</div>
</template>

<script>
	import {tokenApi} from '@/api/demoApi.js'
	export default {
		data () {
			return {
				title: "测试"
			}
		},
		computed: { // dom渲染前

		},
		created: function () { // dom渲染前
			this.title = "demo测试"
		},
		methods: { // 事件
			getToken () {
				let user = {phone: "13609847311", password: "35453110"}
				tokenApi(user).then((response) => {
					console.log(response)
					this.$store.commit("setToken", response.result.token) // 同步
				})
			}
		},
		filters: { // 管道

		},
		components: { // 组建引用

		}
	}

</script>